package com.zmn.plat.services.interfaces.channel;

import com.zmn.plat.common.dto.KVDTO;
import com.zmn.plat.model.entity.channel.ChannelServiceArea;
import com.zmn.plat.model.entity.channel.ChannelServiceAreaQuery;

import java.util.List;

/**
 * 渠道服务区域
 *
 * @author xiangjunming
 * @since 2019 /08/19 12:18:09
 */
public interface ChannelServiceAreaService {

    /**
     * 根据ID查询
     *
     * @param id
     *            the id
     * @return the channel new service area category
     */
    ChannelServiceArea findByKey(Integer id);

    /**
     * 根据渠道ID查询
     *
     * @param channelId
     *            the channel id
     * @return the list
     */
    List<ChannelServiceArea> listByChannelId(Integer channelId);

    /**
     * 根据渠道ID，城市ID查询并且区县ID为NULL
     *
     * @param channelId
     *            the channel id
     * @param cityIds
     *            the city ids
     * @return the list
     */
    List<ChannelServiceArea> listCountryIsNull(Integer channelId, List<Integer> cityIds);

    /**
     * 根据渠道ID，城市ID查询
     *
     * @param channelId
     *            the channel id
     * @param cityIds
     *            the city ids
     * @return the list
     */
    List<ChannelServiceArea> listByChannelIdAndCityIds(Integer channelId, List<Integer> cityIds);

    /**
     * 根据渠道ID，区县ID查询
     *
     * @param channelId
     *            the channel id
     * @param countryIds
     *            the country ids
     * @return the list
     */
    List<ChannelServiceArea> listByChannelIdAndCountryIds(Integer channelId, List<Integer> countryIds);

    /**
     * 描述: 根据查询条件分页查询
     *
     * @param query
     *            the query
     * @return list
     * @auther tanghongjun
     * @since 2019 /8/23 11:45
     */
    List<ChannelServiceArea> listPageByQuery(ChannelServiceAreaQuery query);

    /**
     * 描述: 根据渠道查询相应的城市
     *
     * @param channelId
     *            the query
     * @return list
     * @auther tanghongjun
     * @since 2019 /8/23 11:45
     */
    List<ChannelServiceArea> listCityByChannelId(Integer channelId);

    /**
     * 根据ID修改
     *
     * @param record
     *            the record
     * @return the int
     */
    int updateByKey(ChannelServiceArea record);

    /**
     * 批量更新渠道服务区域更新人和更新时间
     * @param updater
     * @param serviceAreaIds
     * @return
     */
    int updateBatch(String updater, List<Integer> serviceAreaIds);

    /**
     * 新增
     *
     * @param record
     *            the record
     * @return the int
     */
    int insert(ChannelServiceArea record);

    /**
     * 新增批量
     *
     * @param list
     *            the record
     * @return the int
     */
    int insertBatch(List<ChannelServiceArea> list);

    /**
     * 删除
     *
     * @param id
     *            the id
     * @return the int
     */
    int deleteByKey(Integer id);

    /**
     * 批量删除
     *
     * @param ids
     *            the id
     * @return the int
     */
    int deleteByKeys(List<Integer> ids);

    /**
     * 描述: 根据渠道id删除
     *
     * @param channelId 渠道id
     * @return java.lang.Integer
     * @author guoqiao
     * @since 2021/6/9 14:27
     */
    Integer deleteByChannelId(Integer channelId);

    /**
     * 描述: 从旧渠道复制到新渠道
     *
     * @param originalChannelId 原渠道ID
     * @param targetChannelId 新渠道ID
     * @param operator 操作者
     * @return java.lang.Boolean
     * @author guoqiao
     * @since 2021/6/8 13:49
     */
    void copy(Integer originalChannelId, int targetChannelId, String operator);
}